package com.heima.admin.controller;

import com.heima.admin.service.AdUserService;
import com.heima.model.admin.dtos.AdminLoginDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@Slf4j
@Api(tags = "登录相关接口")
@RequiredArgsConstructor
public class LoginController {
    private final AdUserService adUserService;
    @PostMapping("/login/in")
    @ApiOperation("平台管理登录")
    public ResponseResult adminLogin(@RequestBody AdminLoginDto dtos){
        log.info("接收到前端登录的参数为{}",dtos);
        return adUserService.adminLogin(dtos);
    }
}
